/*!
 * \file http_comm.h
 *
 * \brief http comm 函数
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 *
 * \version 3.0
 * \author geyh
 * \date 2016/01/28
 *
 */
#ifndef __HTTP_COMM_H_
#define __HTTP_COMM_H_

#include "http_basedata.h"
L7session_http_private* http_private_create(void);
Http1_session* http1_session_create(void);
Http2_session* http2_session_create(void);

void http1_session_destroy(Http1_session **pp_http1_session);
void http2_session_destroy(Http2_session **pp_http2_session);

int http_field_name_filter(char *p_field_name);

int http_auth_parse(Frreport_body_data *p_st_body_data, char *p_data_in, L7session_http_private *p_st_private);

int http_url_decode(char *p_src, int i_data_len, char **pp_dst);

int http_data_type_detect(char *p_field_value, Http_comm_session *p_comm_session);

int http_session_report(Frreport_body_data *p_st_body_data, L7session_http_private *p_st_private);

int multipart_data_end(char **pp_tcp_body, unsigned int *p_ui_tcp_body_len, L7session_http_private *p_st_private);

int multipart_data_parse(char *p_tcp_body, unsigned int ui_tcp_body_len, Frreport_body_data *p_st_body_data, L7session_http_private *p_st_private, int i_use_request);

int http_session_reset(void **pp_private_session);

int http_header_analysis(char *p_header, char *p_value, L7session_http_private *p_st_private, Frreport_body_data *p_st_body_data, int i_flag_needed, int i_frame_type);

int get_req_data(L7session_http_private *p_st_private, Frreport_body_data *p_st_body_data, char *p_tcp_body, unsigned int ui_tcp_body_len);

int get_resp_data(L7session_http_private *p_st_private, Frreport_body_data *p_st_body_data, char *p_tcp_body, unsigned int ui_tcp_body_len);

int http_req_report(L7session_http_private *p_st_private, Frhash_header *p_st_hash_report);

int http_resp_report(L7session_http_private *p_st_private, Frhash_header *p_st_hash_report);

#endif //__HTTP_COMM_H_
